# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=preeny
pkgver=117.6fa4796
pkgrel=1
pkgdesc='Some helpful preload libraries for pwning stuff.'
groups=('blackarch' 'blackarch-exploitation' 'blackarch-reversing')
arch=('x86_64' 'aarch64')
url='https://github.com/zardus/preeny'
license=('BSD')
depends=('ding-libs' 'libseccomp')
makedepends=('cmake' 'ding-libs' 'git' 'libseccomp' 'make')
source=("git+https://github.com/zardus/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  mkdir -p build
  cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/usr
  cd build
  make
}

package() {
  cd $pkgname

  install -Dm 755 -t "$pkgdir/usr/share/$pkgname/" build/lib/*.so
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

